from paddleocr import PaddleOCR
# 初始化PaddleOcr
ocr = PaddleOCR(use_angle_cls=True, lang="ch")
# ocr = PaddleOcr()
# ocr = PaddleOCR(use_angle_cls=True, lang='ch')

# 定义方法，传入图片路径，返回识别的车牌号码

def recognize_plate_number(image_path):

    result = ocr.ocr(image_path)
    if result:
        plate_no = result[0][0][1][0]
        return plate_no
    else:
        print("车牌号码不存在")
        return None


image_path = "test3.jpg"

res = recognize_plate_number(image_path)

print(f"res: {res}")


